IMPINT page# 0001 next
2: COMMENT ⊗   VALID 00014 PAGES
3: C REC  PAGE   DESCRIPTION
4: C00001 00001
5: C00003 00002    SUBTTL IMP INTERRUPT-LEVEL DRIVERS - JAM, SEPT '71
6: C00005 00003     INPUT BEGINS BY COMING TO HERE. READ THE 72-BIT LEADER THEN
7: C00008 00004     INPUT ROUTINE, READ SUCCESSIVE WORDS AND ZERO OUT BYTES IN LAST WORD
8: C00010 00005     WE GET HERE IF AT INTERRUPT LEVEL WE HAVE A WORD AND NO BUFFER TO PUT IT IN
9: C00012 00006     WE GET HERE WHEN INPUT IS DONE.
10: C00013 00007     ROUTINE TO SET THE WORD COUNT IN THE LAST BUFFER AND
11: C00015 00008     ROUTINE TO SET UP THE BYTE POINTER AND WORD COUNT FOR A BUFFER
12: C00017 00009     CLOCK LEVEL ROUTINE TO GET A SPARE BLOCK
13: C00019 00010     MAIN OUTPUT LOOP
14: C00023 00011     ROUTINE TO QUEUE A MESSAGE FOR OUTPUT.
15: C00025 00012     ROUTINE TO SET THE OUTPUT WORD COUNT AND BYTE POINTER
16: C00027 00013     INPUT INTERRUPT COMES HERE
17: C00029 00014    BEND IMPSER
18: C00030 ENDMK
19: C⊗;
    IMPINT page# 0002 next  prev
21: SUBTTL IMP INTERRUPT-LEVEL DRIVERS - JAM, SEPT '71
22: 
23: ; CONO BITS . . .
24: 
25: TEST←←100000            ; ENTER TEST MODE (DOES ANAL-CRANIAL INVERSION)
26: STRIN←←040000           ; START INPUT, SETS STOP, CLEARS INPUT END
27: I32←←020000             ; SET INPUT BYTE SIZE TO 32B IF IDPIEN SET
28: O32←←010000             ; SET OUTPUT BYTE SIZE TO 32B IF ODPIEN SET
29: CLRST←←004000           ; CLEAR STOP AFTER INPUT BIT
30: CLRWT←←002000           ; CLEAR WAITING TO INPUT BIT
31: STROUT←←000200          ; START OUTPUT
32: FINO←←000100            ; FINISH OUTPUT (LAST BIT HAS BEEN SENT)
33: IEPIEN←←000040          ; ENABLE CHANGE OF INPUT END INTERRUPT CHANNEL
34: IDPIEN←←000020          ; ENABLE CHANGE OF INPUT BYTE SIZE AND INPUT DONE INTERRUPT CHANNEL
35: ODPIEN←←000010          ; ENABLE CHANGE OF OUTPUT BYTE SIZE AND OUTPUT DONE INTERRUPT CHANNEL
36: 
37: ISTART←←STRIN!CLRWT!IEPIEN!IDPIEN!IMPCHN
38: 
39: ; CONI BITS . . .
40: 
41: RDY←←200000             ; IMP READY
42: TEST←←100000            ; ENTER TEST MODE (DOES ANAL-CRANIAL INVERSION)
43: IMPERR←←040000          ; IMP ERROR
44: IDONE←←020000           ; INPUT DONE
45: IEND←←010000            ; INPUT END.
46: ODONE←←004000           ; OUTPUT DONE
    IMPINT page# 0003 next  prev
48: ; INPUT BEGINS BY COMING TO HERE. READ THE 72-BIT LEADER THEN
49: ; SET BYTE SIZE AND READ REST OF MESSAGE.
50: 
51: IBEGIN:
52:         PUSHJ P,SETUP           ; SET UP BYTE POINTER AND COUNT
53:         JRST IHANG              ; NO FREE STORAGE, HANG AND WAIT FOR IT
54:         CONI IMP,AC3
55:         BLKI IMP,IMPBKO         ; READ FIRST WORD
56:         JFCL
57:         MOVE AC1,IMPICUR        ; SET TOP BLOCK OF INPUT
58:         MOVEM AC1,IMPITOP
59:         TRNE AC3,IEND           ; IS THAT ALL THE IMP HAS FOR US?
60:         JRST INPDONE            ; YES, GO PUT LIST ON ILIST
61:         CONO IMP,CLRWT          ; CLEAR THE WAIT FLAG AND READ NEXT WORD
62:         PUSHJ P,ISYNC
63: SECOND: CONI IMP,AC3
64:         BLKI IMP,IMPBKO         ; GET SECOND WORD
65:         JFCL
66:         TRNE AC3,IEND           ; DONE YET?
67:         JRST INPDONE
68:         MOVE AC1,IMPITOP        ; PICK UP ADDRESS OF BLOCK CONTAINING LEADER
69:         LDB AC2,SIZEP           ; PICK UP BYTE SIZE OF TRANSMISSION
70:         SETOM IMPIFM            ; ASSUME 36-BIT MODE
71:         SKIPG AC3,BPW(AC2)      ; PICK UP BITS PER WORD FOR THIS BYTE SIZE
72:         MOVEI AC3,44            ; IF ILLEGAL BYTE SIZE, IT DOESN'T MATTER
73:         CAIN AC3,40
74:         SETZM IMPIFM
75:         IDIVM AC3,AC2           ; NUMBER OF BYTES/WD IN AC2
76:         MOVEI AC3,(AC2)
77:         LDB AC2,COUNTP
78:         IDIVI AC2,(AC3)         ; # WORDS IN AC2, # BYTES IN LAST WORD IN AC3
79:         MOVEM AC2,IMPINW
80:         SETZM IMPIMS            ; PREPARE FOR INTEGRAL NUMBER OF WORDS
81:         JUMPE AC3,INPLOP        ; INTEGRAL NUMBER OF WORDS GETS A ZERO MASK
82:         LDB AC2,SIZEP
83:         MOVNS AC2               ; GET MASK FOR LAST WORD
84:         IMULI AC2,(AC3)
85:         MOVSI AC1,400000
86:         ASH AC1,1(AC2)          ; WE HAVE NOW SPREAD THE BIT OVER THE BYTES
87:         MOVEM AC1,IMPIMS        ; AND THAT IS THE MASK
    IMPINT page# 0004 next  prev
89: ; INPUT ROUTINE, READ SUCCESSIVE WORDS AND ZERO OUT BYTES IN LAST WORD
90: 
91: INPLOP: MOVEI AC1,CLRWT!CLRST!IDPIEN!IEPIEN!IMPCHN
92:         SKIPN IMPIFM            ; WHAT BYTE SIZE?
93:         ORI AC1,I32             ; 32, SET BIT
94:         CONO IMP,(AC1)
95:         PUSHJ P,ISYNC
96: INP1:   CONI IMP,AC3
97:         BLKI IMP,IMPBKO
98:         JFCL
99:         SOSL IMPINW             ; LAST WORD YET?
100:         JRST INPET              ; NO, PROCEED ALONG
101:         HRRZ AC2,IMPBKO
102:         MOVE AC1,IMPIMS         ; YES, PICK UP MASK
103:         ANDM AC1,(AC2)          ; ZERO OUT BYTES IN LAST WORD
104:         SETZM IMPIMS            ; AND ZERO ALL SUCCESSIVE WORDS
105: INPET:  TRNE AC3,IEND
106:         JRST INPDONE
107:         SKIPGE IMPBKO           ; HAS THE COUNT OVERFLOWED?
108:         JRST INPLOP             ; NO, GO BACK FOR NEXT WORD
109:         MOVEI AC1,CLRWT!IDPIEN!IEPIEN!IMPCHN
110:         SKIPN IMPIFM            ; IN WHICH CASE, WAIT AFTER NEXT WORD
111:         ORI AC1,I32
112:         CONO IMP,(AC1)
113:         PUSHJ P,ISYNC
114:         PUSHJ P,SETUP
115:         JRST IDHANG
116:         JRST INP1
    IMPINT page# 0005 next  prev
118: ; WE GET HERE IF AT INTERRUPT LEVEL WE HAVE A WORD AND NO BUFFER TO PUT IT IN
119: 
120: IHANG:  SETOM IMPITOP           ;FLAG TO GETSPARE IN CASE 1 WD MSG
121:         PUSHJ P,HANG
122:         JRST IHEWAIT
123:         MOVE AC1,IMPICUR
124:         MOVEM AC1,IMPITOP       ;SET UP POINTER TO FIRST BLOCK OF MSG
125:         JRST SECOND             ; GO PICK UP THE NEXT WORD
126: 
127: IDHANG: PUSHJ P,HANG
128:         JRST IHEWAIT
129:         JRST INP1               ; GO FINISH FILLING BUFFER
130: 
131: HANG:   AOS NHANGS
132:         CONI IMP,AC1
133:         DATAI IMP,IMPHELP
134:         SETOM IMPHLF
135:         TRNE AC1,IEND
136:         POPJ P,
137:         MOVEI AC1,IEPIEN!IDPIEN
138:         SKIPN IMPIFM
139:         ORI AC1,I32             ; CLEAR PI CHANS SO WON'T INTERRUPT
140:         CONO IMP,(AC1)
141:         PUSHJ P,ISYNC
142:         PUSHJ P,HLPWRD
143:         AOS (P)
144:         JRST GETSPARE           ;WE JUST USED THE SPARE, TRY TO GET A NEW ONE
145: 
146: ; ROUTINE TO PICK UP SAVED WORD AND PLACE IT IN BUFFER
147: 
148: HLPWRD: MOVE AC1,[XWD 1,1]      ; BUMP THE IOWD
149:         ADDB AC1,IMPBKO         ; BOTH HALVES
150:         MOVE AC2,IMPHELP        ; PICK UP SAVED WORD
151:         SETZM IMPIHD            ; CLEAR INPUT-END FLAG
152:         SETZM IMPHLF            ; CLEAR SAVED WORD
153:         MOVEM AC2,(AC1)         ; PLACE IT IN BUFFER
154:         POPJ P,
    IMPINT page# 0006 next  prev
156: ; WE GET HERE WHEN INPUT IS DONE.
157: 
158: INPDONE:
159:         PUSHJ P,IFINISH         ; SET WORD COUNT IN LAST BUFFER AND PUT IT ON ILIST
160:         CONO IMP,ISTART         ; START THE IMP LISTENING FOR INPUT
161: INIWAIT:
162:         PUSHJ P,ISYNC
163:         JRST IBEGIN             ; START A NEW MESSAGE
164: 
165: ; GET HERE WHEN WE INPUTTED THE LAST WORD INTO IMPHELP AND THERE
166: ; IS NO BUFFER FOR IT. CLOCK LEVEL WILL CALL IFINISH THEN
167: ; START THE IMP UP LISTENING AGAIN.
168: 
169: IHEWAIT:
170:         SETOM IMPIHD            ; NOTE THAT THE WORD IN IMPHELP IS THE LAST WORD
171:         CONO IMP,IDPIEN!IEPIEN  ; MAKE SURE WE DON'T INTERRUPT AGAIN
172:         JRST INIWAIT
    IMPINT page# 0007 next  prev
174: ; ROUTINE TO SET THE WORD COUNT IN THE LAST BUFFER AND
175: ; TAG THE ENTIRE BUFFER LIST ONTO ILIST
176: 
177: IFINISH:
178:         AOS NMESIN              ; BUMP NUMBER OF MESSAGES RECEIVED
179:         MOVE AC1,IMPICUR        ; PICK UP POINTER TO CURRENT BUFFER
180:         SETZM IMPICUR           ; MAKE SURE NOBODY IS HOME, SO SETUP WON'T LINK ONTO A NON-EX BLOCK
181:         HLRE AC2,IMPBKO         ; PICK UP WORD COUNT REMAINING
182:         ADD AC2,TLEN(AC1)       ; GET LENGTH OF CURRENT BUFFER
183:         MOVEM AC2,TWC(AC1)      ; USE THAT AS THE WORD COUNT
184:         MOVE AC1,IMPITOP        ; PICK UP FIRST BLOCK OF MESSAGE
185:         SKIPN AC2,ILIST         ; ANYTHING IN THE INPUT LIST?
186:         JRST IFINI1             ; NO, PUT US AS THE FIRST AND LAST ELEMENT
187:         MOVSS AC2
188:         HRLM AC1,TLINK(AC2)     ; LINK US ON TO THE LAST ELEMENT
189: IFINI2: HRLM AC1,ILIST          ; MAKE US THE LAST ELEMENT
190:         HRRZS TLINK(AC1)        ; CLEAR OUR CDR
191:         POPJ P,
192: 
193: IFINI1: HRRM AC1,ILIST          ; MAKE US THE FIRST ELEMENT
194:         JRST IFINI2
    IMPINT page# 0008 next  prev
196: ; ROUTINE TO SET UP THE BYTE POINTER AND WORD COUNT FOR A BUFFER
197: ; IF THERE IS A LIST, IT APPENDS THE NEW BUFFER TO THE END OF THE LIST.
198: ; SKIP RETURNS IF THERE WAS A BUFFER. IF NOT, NO SKIP AND PUT IN
199: ; CLOCK REQUEST TO GET A BUFFER.
200: 
201: SETUP:  PUSHJ P,SETUP0
202:         JRST NOSPARE            ; NO FREE STORAGE, PLANT CLOCK REQUEST, TAKE FAILURE RETURN
203:         PUSHJ P,GETSPARE        ; GET A NEW SPARE BLOCK
204:         JRST CPOPJ1             ; WE WON THIS TIME
205: 
206: SETUP0: SETZ AC1,
207:         EXCH AC1,IMPSPARE
208:         JUMPE AC1,CPOPJ         ; NO FREE STORAGE, GIVE FAILURE RETURN
209:         SETZM TLINK(AC1)
210:         MOVN AC2,TWC(AC1)       ; PICK UP LENGTH OF DATA PORTION OF BLOCK
211:         HRLI AC1,(AC2)          ; PUT NEGATIVE WORD COUNT BESIDE DATA POINTER
212:         SKIPE AC2,IMPICUR       ; IS THERE ALREADY A LIST GOING?
213:         HRRM AC1,TLINK(AC2)     ; YES, APPEND US TO IT
214:         HRRZM AC1,IMPICUR       ; SET US AS CURRENT BLOCK
215:         ADDI AC1,TDATA-1        ; MOVE TO JUST BEFORE DATA PORTION
216:         MOVEM AC1,IMPBKO        ; PUT IN BLKO WORD
217:         JRST CPOPJ1
    IMPINT page# 0009 next  prev
219: ; CLOCK LEVEL ROUTINE TO GET A SPARE BLOCK
220: 
221: GETSP:  SETZM IMPCLN            ; NOTE CLOCK REQUEST SATISFIED
222:         SKIPE IMPDEAD           ; IS THERE ANY IMP?
223:         POPJ P,                 ; NO, FORGET IT
224: GETSPARE:
225:         PUSHJ P,IMPGET          ; SEE IF THERE IS A BLOCK AVAILABLE
226:         JRST NOSPARE
227:         EXCH AC1,IMPSPARE
228:         SKIPE AC1               ; WAS THERE ALREADY ONE?
229:         PUSHJ P,IMPREL          ; YES, GIVE IT BACK
230:         SKIPN IMPHLF            ; IS SOMEONE WAITING FOR IT?
231:         POPJ P,                 ; NO, LEAVE NOW
232:         PUSHJ P,SETUP0          ; YES, SET UP BYTE POINTER AND COUNT
233:         JRST NOSPARE
234:         SKIPN IMPIHD            ; IS IT THE LAST WORD?
235:         JRST GETSP1             ; NO, JUST CLEAR THE WAIT FLAG AND GO
236:         PUSHJ P,HLPWRD          ; PUT LAST WORD IN BUFFER
237:         MOVE AC1,IMPICUR
238:         SKIPGE IMPITOP
239:         MOVEM AC1,IMPITOP       ;SET UP POINTER TO FIRST BLK OF MSG IF FROM IHANG
240:         PUSHJ P,IFINISH         ; PUT LIST ON ILIST
241:         CONO IMP,ISTART         ; START THE IMP LISTENING AGAIN
242:         JRST GETSPARE           ; NOW GET A SPARE AGAIN
243: 
244: GETSP1: SETZM IMPHLF
245:         MOVEI AC1,CLRWT!ODPIEN!IDPIEN!IMPCHN
246:         SKIPN IMPIFM
247:         ORI AC1,I32
248:         CONO IMP,(AC1)          ; START IMP GOING AGAIN, SET UP PI CHANNELS
249:         POPJ P,
250: 
251: ; PLANT A CLOCK REQUEST TO COME BACK AND LOOK FOR FREE STORAGE
252: 
253: NOSPARE:
254:         SETO AC1,
255:         EXCH AC1,IMPCLN
256:         JUMPN AC1,CPOPJ
257:         MOVE AC1,[XWD GETSP,0]
258:         CONO PI,PIOFF
259:         IDPB AC1,CLKQ
260:         CONO PI,PION
261:         POPJ P,
    IMPINT page# 0010 next  prev
263: ; MAIN OUTPUT LOOP
264: 
265: IMPOL:  MOVEI AC2,ODPIEN!IMPCHN
266: NXTTFR: SKIPN IMPOFM
267:         ORI AC2,O32
268:         CONO IMP,(AC2)
269:         BLKO IMP,IMPOBK
270:         JFCL
271:         PUSHJ P,OSYNC
272: OBEGIN:
273:         SETOM IMPOACT           ; NOTE THAT WE ARE STILL ACTIVE
274:         SOSN IMPOFC             ; DECREMENT COUNT OF WORDS LEFT UNTIL 32-BIT MODE
275:         SETZM IMPOFM            ; SWITCH TO 32-BIT MODE
276:         SKIPG IMPOBK            ; DECREMENT COUNT OF WORDS LEFT IN BUFFER
277:         JRST IMPOL
278: NXTBLK: MOVE AC1,IMPOCUR        ; PICK UP POINTER TO CURRENT BLOCK
279:         SKIPG AC2,RSTHST        ; ANY MORE RESETS YET TO BE SENT?
280:         JRST NOTRST             ; NO, RELEASE THIS BLOCK
281:         SOS AC2,RSTHST          ; YES, COUNT DOWN AND LOAD NEW HOST #
282:         DPB AC2,SRCP            ; PUT NUMBER OF NEXT HOST TO BE RESET INTO BLOCK
283:         CONO IMP,FINO           ; WHOLE RESET HAS BEEN SENT
284:         PUSHJ P,OSYNC
285:         MOVE AC1,IMPOCUR        ; GET BACK THE POINTER TO THE BLOCK
286:         JRST IMPOD1             ; NOW USE SAME BLOCK TO SEND NEXT RESET
287: 
288: NOTRST: HRRZ AC2,TLINK(AC1)
289:         MOVEM AC2,IMPOCUR
290:         PUSHJ P,IMPREL          ; RELEASE JUST EMPTIED BLOCK
291:         SKIPN AC1,IMPOCUR       ; IS THERE A NEXT BLOCK?
292:         JRST IMPODN             ; NO, OUTPUT DONE
293:         PUSHJ P,SETCNT          ; YES, SET UP COUNT AND BYTE POINTER
294:         JRST IMPOL              ; START IT GOING
295: 
296: IMPODN: CONO IMP,FINO           ; TELL IMP THE LAST BIT HAS BEEN SENT
297:         PUSHJ P,OSYNC
298:         AOS NMESOU              ; BUMP NUMBER OF MESSAGES TRANSMITTED
299:         SKIPN AC1,OLIST         ; ANYTHING ELSE IN QUEUE?
300:         JRST OWAIT              ; NO, WAIT FOR OUTPUT TO BEGIN
301:         PUSHJ P,LEGAL           ; IS IT A LEGAL BLOCK?
302:         JRST [  SETZM OLIST     ; NO, FLUSH THE ENTIRE OUTPUT LIST
303:                 JRST OWAIT]     ; AND PRETEND IT IS EMPTY
304:         HLRZ AC2,TLINK(AC1)     ; YES, PICK UP FIRST ELEMENT
305:         HRRM AC2,OLIST
306:         SKIPN AC2
307:         SETZM OLIST
308:         HRRZM AC1,IMPOCUR
309: IMPOD1: PUSHJ P,SETMOD          ; SET 32 OR 36 BIT MODE
310:         PUSHJ P,SETCNT
311:         MOVEI AC2,STROUT!ODPIEN!IMPCHN
312:         JRST NXTTFR
313: 
314: DONOP1: CONO IMP,STROUT!ODPIEN!IMPCHN
315:         DATAO IMP,[BYTE (8) 4]  ;NOP
316:         PUSHJ P,OSYNC
317: DONOP:  CONO IMP,FINO
318:         PUSHJ P,OSYNC
319:         SOSLE NOPCNT
320:         JRST DONOP1
321: OWAIT:  SETZM IMPOACT           ; WE ARE NO LONGER ACTIVE
322:         CONO IMP,ODPIEN         ; CLEAR PI CHANNEL SO WE HEAR NO EVIL
323:         PUSHJ P,OSYNC           ; WAIT FOR CLOCK LEVEL TO START US UP
324:         JRST OBEGIN
    IMPINT page# 0011 next  prev
326: ; ROUTINE TO QUEUE A MESSAGE FOR OUTPUT.
327: ; ENTER WITH MESSAGE IN AC1
328: 
329: QOUT:   PUSHJ P,LEGAL           ; REASONABLE BLOCK?
330:         POPJ P,                 ; NO, LEAVE NOW
331:         CONO PI,IMPOFF
332:         SKIPN IMPOACT           ; IS OUTPUT IN PROGRESS?
333:         JRST QIDLE              ; NO, START IT BY HAND.
334:         PUSH P,AC2
335:         SKIPN AC2,OLIST         ; PUT THIS MESSAGE ON THE END OF THE OUTPUT LIST
336:         JRST QNOLIST
337:         MOVSS AC2
338:         HRLM AC1,TLINK(AC2)
339: QOXIT:  HRLM AC1,OLIST
340:         POP P,AC2
341:         HRRZS TLINK(AC1)
342:         CONO PI,IMPON
343:         POPJ P,
344: 
345: QNOLIST:
346:         HRRM AC1,OLIST
347:         JRST QOXIT
348: 
349: ; GET HERE WHEN THE OUTPUT SIDE OF THE IMP IS IDLE
350: 
351: QIDLE:  CONO PI,IMPON           ; NO NEED TO BOTHER WITH INTERLOCKING
352:         SETOM IMPOACT
353:   MOVEM AC1,IMPOCUR
354:         PUSH P,AC3
355:         PUSHJ P,SETMOD          ; SET UP COUNT OF NUMBER OF WORDS IN 36B MODE
356:         PUSHJ P,SETCNT          ; SET UP BYTE POINTER AND COUNT
357:         MOVEI AC3,MAXCNT        ; SET UP OUTPUT TIMEOUT
358:         MOVEM AC3,IMPOCT
359:         POP P,AC3
360:         CONO PI,IMPOFF
361:         CONO IMP,STROUT!ODPIEN!IMPCHN
362:         BLKO IMP,IMPOBK
363:         JFCL
364:         CONO PI,IMPON
365:         POPJ P,
    IMPINT page# 0012 next  prev
367: ; ROUTINE TO SET THE OUTPUT WORD COUNT AND BYTE POINTER
368: 
369: SETCNT: MOVN AC2,TWC(AC1)       ; PICK UP SIZE OF BLOCK
370:         HRLI AC2,TDATA-1(AC1)   ; PUT IN ONE BEFORE DATA PORTION OF BUFFER
371:         MOVSM AC2,IMPOBK        ; PLACE IN OUTPUT BLKO WORD
372:         POPJ P,
373: 
374: ; ROUTINE TO DO SOFTWARE RELOCATION ON ADDESS IN TAC1
375: ; PUTS RESULT IN DSER
376: 
377: DOLOC:  HRRZI DSER,(TAC1)       ; MOVE USER ADDRESS TO DSER
378:         TRNN DSER,400000        ; UPPER SEGMENT ADDRESS?
379:         JRST EOREL              ; NO, USE PROG
380:         PUSH P,TEM
381:         LDB TEM,PSEGN           ; YES, PICK UP REL. OF UPPER
382:         HRRZ TEM,JBTADR(TEM)
383:         ADDI DSER,-400000(TEM)
384:         POP P,TEM
385:         POPJ P,
386: 
387: EOREL:  ADDI DSER,(PROG)
388:         POPJ P,
389: 
390: ; ROUTINE TO SET THE COUNT OF THE NUMBER OF WORDS IN 36B MODE
391: 
392: SETMOD: LDB AC2,SIZEP
393:         MOVEI AC3,2
394:         CAIN AC2,44             ; UNLESS MOVE IS 36B, USE 32B
395:         SETO AC3,
396:         MOVEM AC3,IMPOFC        ; SET NUMBER OF WORDS IN 36B
397:         SETOM IMPOFM            ; WE ALWAYS START IN 36B MODE
398:         POPJ P,
    IMPINT page# 0013 next  prev
400: ; INPUT INTERRUPT COMES HERE
401: 
402: IMPINT:
403:         CONSO IMP,770           ; ANY CHANNEL?
404:         JRST IMPOTS             ; NO, CAN'T BE US
405:         MOVEM AC1,IMPAC1
406:         MOVEM AC2,IMPAC2
407:         MOVEM AC3,IMPAC3
408:         EXCH PID,IMPPID
409:         EXCH P,IMPIPD
410:         JRST @IMPIDSP
411: 
412: ISYNC:  POP P,IMPIDSP
413:         EXCH P,IMPIPD
414: ACREST: MOVE AC1,IMPAC1
415:         MOVE AC2,IMPAC2
416:         MOVE AC3,IMPAC3
417:         EXCH PID,IMPPID
418:         JEN @IMPCHL
419: 
420: ; OUTPUT INTERRUPTS COME HERE
421: 
422: IMPOUT:
423:         CONSO IMP,7
424:         JRST IMPCTS
425:         MOVEM AC1,IMPAC1
426:         MOVEM AC2,IMPAC2
427:         MOVEM AC3,IMPAC3
428:         HRLOI AC3,377777
429:         MOVEM AC3,IMPOCT
430:         EXCH PID,IMPPID
431:         EXCH P,IMPOPD
432:         JRST @IMPODSP
433: 
434: OSYNC:  POP P,IMPODSP
435:         MOVEI AC3,MAXCNT
436:         SKIPL IMPOACT
437:         HRLOI AC3,377777
438:         MOVEM AC3,IMPOCT
439:         EXCH P,IMPOPD
440:         JRST ACREST
441: 
442: ; GET HERE ON ERROR BIT
443: 
444: IMPERB:
445:         MOVEM AC1,IMPAC1
446:         MOVEI AC1,IDPIEN!IMPCHN
447:         SKIPN IMPIFM
448:         ORI AC1,I32
449:         CONO IMP,(AC1)          ; CLEAR ERROR BIT
450:         MOVE AC1,IMPAC1
451:         AOS IMPECT              ; NOTE ANOTHER ERROR BIT DETECTED
452:         JEN @IMPCHL
    IMPINT page# 0014 next  prev
454: BEND IMPSER
 EOF: IMPINT end-of-file. cnt=13